<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c"  uri="/c.tld" %>
<%@ taglib prefix="fmt"  uri="/fmt.tld" %>
<%@ taglib prefix="fn" uri="/fn.tld" %> 
<%@ page import="com.stone.para.IConstant"%>
<%
	String contextPath = request.getContextPath();
%>

<head>
	<link href="<%=contextPath%>/css/style.css" rel="stylesheet" type="text/css" />
	<link href="<%=contextPath%>/css/page.css" rel="stylesheet" type="text/css" />	
	<script type="text/javascript" src="<%=contextPath%>/js/jquery-1.4.2.js"></script>
	<script type="text/javascript" src="<%=contextPath%>/js/style.js"></script>	
	<script type="text/javascript" src="<%=request.getContextPath() %>/js/openSUB.js" ></script>
	<script type="text/javascript" src="<%=contextPath%>/ext3/adapter/ext/ext-base.js"></script>
	<script type="text/javascript" src="<%=contextPath%>/ext3/ext-all.js"></script>
	<script type="text/javascript" src="<%=contextPath%>/ext3/ext-lang-zh_CN.js"></script>	
	<link rel="stylesheet" type="text/css"	href="<%=contextPath%>/ext3/resources/css/ext-all.css">	
	<script language="javascript">
	
		Ext.BLANK_IMAGE_URL = '<%=contextPath%>/ext3/resources/images/default/s.gif';
        Ext.QuickTips.init();
        Ext.form.Field.prototype.msgTarget = 'qtip';
       	Ext.lib.Ajax.defaultPostHeader += '; charset=utf-8';
       	
       	var contextpath = '<%=contextPath%>';
       	
       	Date.prototype.toString=function() {
			return this.format("Y-m-d");
		};
    	

		// 查询条件隐藏
		function displayquerydiv(){

				if (querydiv.style.display=="") {
	    			querydiv.style.display="none";
					frmM.elements["searchBean.displayFlag"].value="0";
				
				} else {
	    			querydiv.style.display="";
					frmM.elements["searchBean.displayFlag"].value="1";
				}

 				return;
		}
		
		// 获得变电站
		function getBdz(bdz, bdzname, ouid) {
         	var url = "<%=contextPath%>/jsp/popup/bdzorganCheckBoxPopup.jsp?bdz="+ bdz +"&bdzname=" + bdzname + "&ouid=" + ouid;// + "&ouid=" + document.frmM.elements["searchBean.con1"].value;
         	var win = openSUB(url,2,300,520,450,30);
		}
		// 获得变电站jx
		function getBdzjx(bdz, bdzname) {
         	var url = "<%=contextPath%>/jsp/popup/jxorganCheckBoxPopup.jsp?bdz="+ bdz +"&bdzname=" + bdzname;// + "&ouid=" + document.frmM.elements["searchBean.con1"].value;
         	var win = openSUB(url,2,300,520,450,30);
		}
		// 获得班组
		function getBz(bz, bzname, ouid) {
         	var url = "<%=contextPath%>/jsp/popup/organCheckBoxPopup.jsp?bz="+ bz +"&bzname=" + bzname + "&ouid=" + ouid;
         	var win = openSUB(url,2,300,520,450,30);
		}
		
		    // 获得用户
	  function getUser(userid, username,opernerType) {

         		var url = "<%=contextPath%>/jsp/popup/userCheckBoxPopup.jsp?userid="+ userid +"&username=" + username+"&opernerType=" + opernerType;//+"&organid=" + bdz;// + "&ouid=" + document.frmM.elements["searchBean.con1"].value;
         		var win = openSUB(url,2,300,520,450,30);  //4 有滚动条
		    }
// 获得变电站seltec
		function getBdzselect(bdz, bdzname) {
         	var url = "<%=contextPath%>/jsp/popup/selectOrganTree.jsp?opernerId="+ bdz +"&opernerName=" + bdzname;// + "&ouid=" + document.frmM.elements["searchBean.con1"].value;
         	var win = openSUB(url,2,300,520,450,30);
		}
		// 获得机构人员seltec
		function getUserselect(bdz, bdzname,opernerType) {
         	var url = "<%=contextPath%>/jsp/popup/selectUserTree.jsp?opernerId="+ bdz +"&opernerName=" + bdzname+"&opernerType=" + opernerType;// + "&ouid=" + document.frmM.elements["searchBean.con1"].value;
         	var win = openSUB(url,2,300,520,450,30);
		}
		// 附件弹出
	 	function filePopup(id,colname,imageflag,path) {
		    	var url = "<%=contextPath%>/jsp/common/fileTab.jsp?tableid=" + id + "&colname="+colname+"&imageflag="+imageflag+"&filepath="+path;// "<%=contextPath%>/sb!test.do?id="+id;
		    	var win = openSUB(url,2,850,500,450,30);
		}
		   
		// 附件只读弹出
	 	function filePopupReadonly(id,colname,imageflag) {
		    	var url = "<%=contextPath%>/jsp/common/fileTabReadonly.jsp?tableid=" + id + "&colname="+colname+"&imageflag="+imageflag;// "<%=contextPath%>/sb!test.do?id="+id;
		    	var win = openSUB(url,2,850,500,450,30);
		}			    
		    // 常用短语
			function getCydy(dytype, colName)
			{
				var errI=0;
				
         		var url = "<%=contextPath%>/dic!initCydy.do?cydy.dytype=" + dytype+"&cydy.parentColName="+colName;// + "&ouid=" + document.frmM.elements["searchBean.con1"].value;
         		
         		var win = openSUB(url,2,300,500,450,30);
			}
		// 清空form
		function resetForm() {
		    
				var formMain = document.getElementById("frmM");
				
						for (i=0; i<formMain.length; i=i+1 ) {
							if (("text" == formMain[i].type 
								|| "textarea" == formMain[i].type) && formMain[i].id.indexOf("searchBean.con1") == -1) {
		
								formMain[i].value = "";
		
							} else if ("select-one" == formMain[i].type && formMain[i].disabled != true) {
								formMain[i].selectedIndex = 0;
							} else if ("checkbox" == formMain[i].type) {
								formMain[i].checked = false;
							}else if ("radio" == formMain[i].type) {
							    if(formMain[i].checked){
								          formMain[i].checked = false;
								}
							}
						}	
		 }
		 
		 String.prototype.startWith=function(str){
	if(str==null||str==""||this.length==0||str.length>this.length)
	return false;
	if(this.substr(0,str.length)==str)
	return true;
	else
	return false;
	return true;
	}

String.prototype.endWith=function(str){
	if(str==null||str==""||this.length==0||str.length>this.length)
	return false;
	if(this.substring(this.length-str.length)==str)
	return true;
	else
	return false;
	return true;
	}
			
	</script>
</head>